package com.sgb.contract.view.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.sgb.contract.R;
import com.sgb.contract.databinding.ContractFragmentOperationRecordsBinding;
import com.swgk.core.base.AppLazyFragment;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;

/**
 * 操作记录 Fragment
 *
 * @author cyj
 */
public class OperationRecordsFragment extends AppLazyFragment {
    private ContractFragmentOperationRecordsBinding mBinding;
    private OperationRecordsViewModel mModel;

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mBinding = DataBindingUtil.inflate(inflater, R.layout.contract_fragment_operation_records, container, false);
        return mBinding.getRoot();
    }

    @Override
    protected void initView() {
        mModel = new ViewModelProvider(this).get(OperationRecordsViewModel.class);
        mBinding.rlvView.setAdapter(mModel.adapter);
    }

    @Override
    protected void onLazyLoad() {
        mModel.getContractLog(getActivity().getIntent().getStringExtra("contractNo"));
    }
}
